<?php

namespace app\common\model;

use think\Model;

class Report extends Model
{

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'add_time';
    protected $updateTime = '';
    // 追加属性
    protected $append = [];

    public static function addReport($user_id,$circle_id,$reason_id,$content)
    {
        $circle_info = UserCircle::get_circle_info($circle_id,$user_id);
        $report_data = [];
        $report_data["user_id"] = $user_id;
        $report_data["reason_id"] = $reason_id;
        $report_data["content"] = $content;
        $report_data["circle_id"] = $circle_id;
        $report_data["circle_cate_name"] = $circle_info["cate_name"];
        $report_data["circle_vehicle_name"] = $circle_info["vehicle_name"];
        $report_data["circle_title"] = $circle_info["title"];
        $report_data["circle_content"] = $circle_info["content"];
        $report_data["circle_image"] = $circle_info["image"];
        $report_data["circle_content_images"] = $circle_info["content_images"];
        $report_data["circle_price"] = $circle_info["price"];
        $report_data["circle_base_price"] = $circle_info["base_price"];
        $res = self::create($report_data);
        return $res;
    }
}
